package com.effectiv.crm.domain;

import java.io.Serializable;

import lombok.Data;
import lombok.EqualsAndHashCode;

import org.joda.time.DateTime;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.annotation.Version;
import org.springframework.data.mongodb.core.mapping.DBRef;

@EqualsAndHashCode(exclude={"version","createdDate","lastModifiedDate","createdBy","lastModifiedBy","deleted"})
@Data
public abstract class AbstractDocument implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	private String id;

	@Version
	private Long version;

	@CreatedDate
	private DateTime createdDate;

	@LastModifiedDate
	private DateTime lastModifiedDate;

	@DBRef
	@CreatedBy
	private User createdBy;

	@DBRef
	@LastModifiedBy
	private User lastModifiedBy;
	
	private boolean deleted;
}
